/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.wx.entity;

import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * wx_business_userEntity
 * @author wangjianxin
 * @version 2018-11-13
 */
@Table(name="wx_business_user", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="business_id", attrName="businessId", label="商家id"),
		@Column(name="user_id", attrName="userId", label="关联的user表中的id"),
		@Column(name="user_openid", attrName="userOpenid", label="关联的user表中的openid"),
		@Column(name="user_name", attrName="userName", label="员工姓名", queryType=QueryType.LIKE),
		@Column(name="phone", attrName="phone", label="员工手机号"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class WxBusinessUser extends DataEntity<WxBusinessUser> {
	
	private static final long serialVersionUID = 1L;
	private Long businessId;		// 商家id
	private Long userId;		// 关联的user表中的id
	private String userOpenid;		// 关联的user表中的openid
	private String userName;		// 员工姓名
	private String phone;		// 员工手机号


	/**
	 * 添加字段
	 */
	private String businessName;
	private String nickName;

	private WxUser wxUser;

	public WxBusinessUser() {
		this(null);
	}

	public WxBusinessUser(String id){
		super(id);
	}
	
	public Long getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Long businessId) {
		this.businessId = businessId;
	}
	
	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	@Length(min=0, max=200, message="关联的user表中的openid长度不能超过 200 个字符")
	public String getUserOpenid() {
		return userOpenid;
	}

	public void setUserOpenid(String userOpenid) {
		this.userOpenid = userOpenid;
	}
	
	@Length(min=0, max=255, message="员工姓名长度不能超过 255 个字符")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	@Length(min=0, max=200, message="员工手机号长度不能超过 200 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getBusinessName() {
		return businessName;
	}

	public void setBusinessName(String businessName) {
		this.businessName = businessName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public WxUser getWxUser() {
		return wxUser;
	}

	public void setWxUser(WxUser wxUser) {
		this.wxUser = wxUser;
	}
}